package cn.monkey.family.data.context;

import cn.monkey.family.data.uc.auth.UserSession;

public class ThreadLocalUserSessionContextHolder implements UserSessionContextHolder {

    private final InheritableThreadLocal<UserSession> threadLocal = new InheritableThreadLocal<>();

    @Override
    public void set(UserSession session) {
        threadLocal.set(session);
    }

    @Override
    public UserSession get() {
        return threadLocal.get();
    }

    @Override
    public void remove() {
        threadLocal.remove();
    }
}
